If the user requests a version less than 3.2 the version is forced to 3.2.
Previous checking code have an inconsistent behavior depending on which
minor version number was specified. This is avoided now by temporarily
converting the major/minor pair into a single integer.
https://bugzilla.gnome.org/show_bug.cgi?id=744288
int major,
int minor)
{
+ int version;
GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context);
g_return_if_fail (GDK_IS_GL_CONTEXT (context));
return;
}
- priv->major = MAX (major, 3);
-
- /* we only support versions ≥ 3.2 */
- if (priv->major == 3)
- priv->minor = MAX (minor, 2);
- else
- priv->minor = minor;
+ /* Enforce a minimum context version number of 3.2 */
+ version = (major * 100) + minor;
+ if (version < 302)
+ {
+ g_warning ("gdk_gl_context_set_required_version - GL context versions less than 3.2 are not supported.");
+ version = 302;
+ }
+ priv->major = version / 100;
+ priv->minor = version % 100;
}
/**